\(\int (d x)^{-1+n} \log ^2(c x^n) \, dx\) [157]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 16, antiderivative size = 53 \[ \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx=\frac {2 (d x)^n}{d n}-\frac {2 (d x)^n \log \left (c x^n\right )}{d n}+\frac {(d x)^n \log ^2\left (c x^n\right )}{d n} \]

[Out]

2*(d*x)^n/d/n-2*(d*x)^n*ln(c*x^n)/d/n+(d*x)^n*ln(c*x^n)^2/d/n

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2342, 2341} \[ \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx=\frac {(d x)^n \log ^2\left (c x^n\right )}{d n}-\frac {2 (d x)^n \log \left (c x^n\right )}{d n}+\frac {2 (d x)^n}{d n} \]

[In]

Int[(d*x)^(-1 + n)*Log[c*x^n]^2,x]

[Out]

(2*(d*x)^n)/(d*n) - (2*(d*x)^n*Log[c*x^n])/(d*n) + ((d*x)^n*Log[c*x^n]^2)/(d*n)

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(d x)^n \log ^2\left (c x^n\right )}{d n}-2 \int (d x)^{-1+n} \log \left (c x^n\right ) \, dx \\ & = \frac {2 (d x)^n}{d n}-\frac {2 (d x)^n \log \left (c x^n\right )}{d n}+\frac {(d x)^n \log ^2\left (c x^n\right )}{d n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.57 \[ \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx=\frac {(d x)^n \left (2-2 \log \left (c x^n\right )+\log ^2\left (c x^n\right )\right )}{d n} \]

[In]

Integrate[(d*x)^(-1 + n)*Log[c*x^n]^2,x]

[Out]

((d*x)^n*(2 - 2*Log[c*x^n] + Log[c*x^n]^2))/(d*n)

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.96

method result size
parallelrisch \(-\frac {-\left (d x \right )^{n -1} \ln \left (c \,x^{n}\right )^{2} x +2 \left (d x \right )^{n -1} x \ln \left (c \,x^{n}\right )-2 \left (d x \right )^{n -1} x}{n}\) \(51\)
risch \(\text {Expression too large to display}\) \(750\)

[In]

int((d*x)^(n-1)*ln(c*x^n)^2,x,method=_RETURNVERBOSE)

[Out]

-(-(d*x)^(n-1)*ln(c*x^n)^2*x+2*(d*x)^(n-1)*x*ln(c*x^n)-2*(d*x)^(n-1)*x)/n

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.79 \[ \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx=\frac {{\left (n^{2} \log \left (x\right )^{2} + \log \left (c\right )^{2} + 2 \, {\left (n \log \left (c\right ) - n\right )} \log \left (x\right ) - 2 \, \log \left (c\right ) + 2\right )} d^{n - 1} x^{n}}{n} \]

[In]

integrate((d*x)^(-1+n)*log(c*x^n)^2,x, algorithm="fricas")

[Out]

(n^2*log(x)^2 + log(c)^2 + 2*(n*log(c) - n)*log(x) - 2*log(c) + 2)*d^(n - 1)*x^n/n

Sympy [A] (verification not implemented)

Time = 0.47 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.09 \[ \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx=\begin {cases} \frac {x \left (d x\right )^{n - 1} \log {\left (c x^{n} \right )}^{2}}{n} - \frac {2 x \left (d x\right )^{n - 1} \log {\left (c x^{n} \right )}}{n} + \frac {2 x \left (d x\right )^{n - 1}}{n} & \text {for}\: n \neq 0 \\\frac {\log {\left (c \right )}^{2} \log {\left (x \right )}}{d} & \text {otherwise} \end {cases} \]

[In]

integrate((d*x)**(-1+n)*ln(c*x**n)**2,x)

[Out]

Piecewise((x*(d*x)**(n - 1)*log(c*x**n)**2/n - 2*x*(d*x)**(n - 1)*log(c*x**n)/n + 2*x*(d*x)**(n - 1)/n, Ne(n,
0)), (log(c)**2*log(x)/d, True))

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00 \[ \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx=-\frac {2 \, d^{n - 1} x^{n} \log \left (c x^{n}\right )}{n} + \frac {2 \, d^{n - 1} x^{n}}{n} + \frac {\left (d x\right )^{n} \log \left (c x^{n}\right )^{2}}{d n} \]

[In]

integrate((d*x)^(-1+n)*log(c*x^n)^2,x, algorithm="maxima")

[Out]

-2*d^(n - 1)*x^n*log(c*x^n)/n + 2*d^(n - 1)*x^n/n + (d*x)^n*log(c*x^n)^2/(d*n)

Giac [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.72 \[ \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx=\frac {d^{n} n x^{n} \log \left (x\right )^{2}}{d} + \frac {2 \, d^{n} x^{n} \log \left (c\right ) \log \left (x\right )}{d} + \frac {d^{n} x^{n} \log \left (c\right )^{2}}{d n} - \frac {2 \, d^{n} x^{n} \log \left (x\right )}{d} - \frac {2 \, d^{n} x^{n} \log \left (c\right )}{d n} + \frac {2 \, d^{n} x^{n}}{d n} \]

[In]

integrate((d*x)^(-1+n)*log(c*x^n)^2,x, algorithm="giac")

[Out]

d^n*n*x^n*log(x)^2/d + 2*d^n*x^n*log(c)*log(x)/d + d^n*x^n*log(c)^2/(d*n) - 2*d^n*x^n*log(x)/d - 2*d^n*x^n*log
(c)/(d*n) + 2*d^n*x^n/(d*n)

Mupad [F(-1)]

Timed out. \[ \int (d x)^{-1+n} \log ^2\left (c x^n\right ) \, dx=\int {\ln \left (c\,x^n\right )}^2\,{\left (d\,x\right )}^{n-1} \,d x \]

[In]

int(log(c*x^n)^2*(d*x)^(n - 1),x)

[Out]

int(log(c*x^n)^2*(d*x)^(n - 1), x)